package one.stand.service.impl;

import com.github.vioao.wechat.api.component.AccountApi;
import com.github.vioao.wechat.bean.response.BaseResponse;
import one.stand.service.AccountService;
import one.stand.service.ComponentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: QIK
 * @CreateDate: 2019/5/13 13:33
 */
@Service
public class AccountServiceImpl extends PublicBaseService implements AccountService {
    @Autowired
    ComponentService componentService;
    @Override
    public BaseResponse bind(String appId, String openAppId) {
        String token=componentService.getComponentToken();
        return AccountApi.bind(token,appId,openAppId);
    }
    @Override
    public BaseResponse add(String appId){
        return AccountApi.create(componentService.getComponentToken(),appId);
    }
}
